package com.coincalf.feign.hystrix;

import com.coincalf.dto.MarketDTO;
import com.coincalf.dto.TradeMarketDTO;
import com.coincalf.feign.MarketServiceClient;
import com.coincalf.framework.dto.ForexMarketDTO;
import com.coincalf.framework.enums.ResultCode;
import com.coincalf.framework.http.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

/**
 * @author qiang
 */
@Slf4j
@Component
public class MarketServiceClientFallback implements MarketServiceClient {

    /**
     * 币币交易市场行情
     *
     * @return
     */
    @Override
    public List<MarketDTO> tradeMarkets() {
        log.warn("微服务获取币币交易市场信息(接口:/trade/market/all2)服务降级");
        return Collections.emptyList();
    }

    /**
     * 创新交易市场行情
     *
     * @return
     */
    @Override
    public List<MarketDTO> forexMarkets() {
        return Collections.emptyList();
    }

    /**
     * 币币交易市场深度
     *
     * @param symbol    交易对标识符
     * @param mergeType 合并深度类型
     * @return
     */
    @Override
    public Response depth(String symbol, String mergeType) {
        return Response.ok();
    }

    /**
     * 获取最新成交列表
     *
     * @param symbol 交易对标识符
     * @return
     */
    @Override
    public Response trades(String symbol, Integer size) {
        log.warn("微服务调用降级-/trade/market/trades/{}/{}", symbol, size);
        return Response.ok();
    }

    @Override
    public List<TradeMarketDTO> queryTradeMarkets() {
        return Collections.emptyList();
    }

    @Override
    public List<ForexMarketDTO> queryForexMarkets() {
        return Collections.emptyList();
    }

    @Override
    public List<TradeMarketDTO> queryTradeMarketsByIds(String marketIds) {
        return Collections.emptyList();
    }

    @Override
    public List<ForexMarketDTO> queryForexMarketsByIds(String marketIds) {
        return Collections.emptyList();
    }

    /**
     * 刷新币币交易市场
     *
     * @param marketId 交易对ID
     * @return
     */
    @Override
    public boolean refreshTradeMarket(Long marketId) {
        return false;
    }

    /**
     * 刷新创新交易市场
     *
     * @param marketId 交易对ID
     * @return
     */
    @Override
    public boolean refreshForexMarket(Long marketId) {
        return false;
    }

    @Override
    public long getBySymbol(String symbol) {
        return 0L;
    }
}
